<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .faf {
            background-color: skyblue;
        }

        .faa {
            background-color: purple;
        }
    </style>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(item,index) in sports" :class="{faf:index%2==0,faa:index%2!=0}">{{item}}</li>
        </ul>
    </div>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
                sports: ["篮球", "足球", "瑜伽", "跑步", "羽毛球"]
            }
        })
    </script>
</body>

</html>